package com.goblin.model.order.po;

import com.goblin.model.base.BaseEntity;
import com.goblin.model.uaa.po.CustomerUser;
import lombok.Data;

import javax.persistence.*;

@Data
@Table(name = "t_order_cart")
@Entity
public class Cart extends BaseEntity {

    @Column(name = "goods_name", columnDefinition = "varchar(255) COMMENT '商品名称'")
    private String goodsName;

    @Column(name = "goods_num", columnDefinition = "varchar(255) COMMENT '商品数量'")
    private String goodsNum;

    @Column(name = "goods_price", columnDefinition = "varchar(255) COMMENT '商品价格'")
    private String goodsPrice;

    @Column(name = "status", columnDefinition = "varchar(1) COMMENT '状态 标记是否完成下单'")
    private String status;

    @OneToOne(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
    @JoinColumn(name = "store_id", referencedColumnName = "id", nullable = false, columnDefinition = " int(11) COMMENT '商铺id'")
    private Store store;

    @OneToOne(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
    @JoinColumn(name = "sku_id", referencedColumnName = "id", nullable = false, columnDefinition = " int(11) COMMENT 'sku id'")
    private SKU sku;

    @OneToOne(cascade = CascadeType.MERGE, fetch = FetchType.EAGER)
    @JoinColumn(name = "user_id", referencedColumnName = "id", nullable = false, columnDefinition = " int(11) COMMENT '创建人id'")
    private CustomerUser customerUser;
}
